package client;

import java.io.File;
import java.util.Date;

import dataContracts.SharedFile;

public class ClientFile extends SharedFile {

	public ClientFile(String filePath) {
		this(new File(filePath));
	}
	
	public ClientFile(File file) {
		super(file);
	}

	@Override public boolean equals(Object o) {
		// if it's an object of different type it's always false
		if (!(o instanceof ClientFile))
			return false;
		
		// cast the object to Rational
		ClientFile other = (ClientFile)o;
		// since the Rational is always reduced we can do this simple compare
		if (this.getChecksum().equals(other.getChecksum())) {
			return true;
		}
		
		return false;
	}
	
	// we must override this since we overrode equals above
	@Override public int hashCode() {
		// factor in each field used in the equals method
		return getChecksum().hashCode();
	}
}
